<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>食品经营许可证延续</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="#(basePath)/static/jquery-weui/css/weui.min.css">
    <link rel="stylesheet" href="#(basePath)/static/jquery-weui/css/jquery-weui.min.css">
    <link rel="stylesheet" href="#(basePath)/static/web/index/css/index.css">
</head>
<body>
<div class="page">
    <div class="page__hd">
        <header class="weui-header">
            <h1 class="weui-header-title">《食品经营许可证》<br/>延续</h1>
        </header>
    </div>
    <div class="page__bd page__bd_spacing">
        <form action="#(basePath)/wfw/spyxmp/spjyxkz/save" id="form" data-role="form">
            <input type="hidden" name="type" value="4">
            <div class="weui-cells__title">食品经营许可证号</div>
            <div class="weui-cells">
                <div class="weui-cell weui-cell_select weui-cell_select-before">
                    <div class="weui-cell__hd">
                        <select class="weui-select" name="spjyxkzPrefix">
                            <option value="JY">JY</option>
                        </select>
                    </div>
                    <div class="weui-cell__bd weui-cell__primary">
                        <input class="weui-input" type="number" name="spjyxkzhHz" data-name="spjyxkz" value="#(data.spjyxkzh??)"
                               placeholder="请输入食品经营许可证号" required>
                        <input type="hidden" name="spjyxkzh" value="#(data.spjyxkzh??)">
                    </div>
                </div>
            </div>
            <div class="weui-cells__tips">请输入《食品经营许可证》编号“JY”后面几位</div>
            <div id="yxxx">
                <div class="weui-cells__title">延续有效日期</div>
                <div class="weui-cells">
                    <div class="weui-cell">
                        <div class="weui-cell__hd">
                            <label class="weui-label">当前有效</label>
                        </div>
                        <div class="weui-cell__bd weui-cell__primary">
                            <input class="weui-input" type="text" name="dqyxrq"
                                   placeholder="当前有效日期" required readonly>
                        </div>
                    </div>
                    <div class="weui-cell">
                        <div class="weui-cell__hd">
                            <label class="weui-label">延续有效</label>
                        </div>
                        <div class="weui-cell__bd weui-cell__primary">
                            <input class="weui-input" type="text" name="yxhyxrq"
                                   placeholder="延续后有效日期" required readonly>
                        </div>
                    </div>
                </div>
            </div>
            <div class="weui-cells">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">联系人名称</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" name="lxr" value="#(data.lxr??==null?session.wxUserInfo.name:data.lxr??)"
                               placeholder="请输入联系人名称" required>
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">联系人电话</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="tel" name="lxrdh" value="#(data.lxrdh??==null?session.wxUserInfo.phone:data.lxrdh??)"
                               placeholder="请输入联系人电话" required>
                    </div>
                </div>
            </div>
            <div class="weui-btn-area">
                #if(model??=="readonly")
                <a href="#(basePath)/wfw/spyxmp/applyItem/toSbls" class="weui-btn weui-btn_primary">返回申报历史</a>
                #else
                <button class="weui-btn weui-btn_primary" type="submit">提交申请</button>
                #end
            </div>
            <br><br>
        </form>
    </div>

    <div class="page__footer">

        #include("/WEB-INF/main/footer-spyxmp.html")
    </div>
</div>
<script src="#(basePath)/static/js/weuiUpload.js"></script>
<script src="#(basePath)/static/web/index/js/index.js"></script>
<script src="#(basePath)/static/jquery-weui/js/cui-select.js"></script>
<script src="#(basePath)/static/web/spyxmp/js/xkzbh.js"></script>
</body>
<script type="text/javascript">
    window.initData = function(data){
        var yxqOld = data['有效期至'];
        if(yxqOld){

            // $('#yxxx').slideDown();
            var yxqArray = yxqOld.split('-');
            var yxqN = yxqArray[0];

            var yxq = (parseInt(yxqN) + 5) + '-' + yxqArray[1] + '-' + yxqArray[2];

            $('input[name=dqyxrq]').val(yxqOld);
            $('input[name=yxhyxrq]').val(yxq);
        }
    }
</script>

</html>
